package com.uenpay.oem.util.share;

import android.content.Context;

import com.mob.commons.SHARESDK;
import com.uenpay.oem.common.AppConstant;
import com.uenpay.oem.widget.share.onekeyshare.OnekeyShare;

import cn.sharesdk.framework.ShareSDK;

/**
 * Created by DELL on 2017/7/3.
 */

public class ShareUtils {

    private static OnekeyShare oks;
    private static String imagePath="";

    public static void setImagePath(String path) {
        if (null != path) {
            imagePath = path;
        }
    }

    /**
     *  显示分享对话框
     * @param activity
     */
    public static void showShare(Context activity){
        if (null == oks)
            oks = new OnekeyShare();
        oks.setTitle("微付宝上线啦！");
        oks.setText("扫码，收款，转账，聊天，方便快捷等你来撩~");
        //QQ和QQ空间的链接
        oks.setTitleUrl(AppConstant.SHARE_TARGET_URL);
        oks.setImagePath(imagePath);
        //微信和朋友圈的链接
        oks.setUrl(AppConstant.SHARE_TARGET_URL);
        // 启动分享GUI
        oks.show(activity);
    }

    public static void destroyShare(){
        ShareSDK.stopSDK();
    }
}
